<html>
<head>
<meta http-equiv="content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
*{
	margin:0px;
	padding:0px;
}
body{
	font-size:12px;
	font-family:"宋体",Arial, Helvetica, sans-serif;
}
img{
	border:0px none;
}
table{
	border-collapse:collapse;border-spacing:0;
}
th,td{padding:5px}
input{
	outline:none;
}
input.txt {background-color: #f9f9f9;border: 1px solid #CCCCCC;border-radius: 2px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) inset;color: #666666;font-family: Arial,Verdana,'Helvetica Neue',Helvetica,Arial,Geneva,sans-serif;font-size: 12px;height: 26px;margin-bottom: 6px;margin-right:6px;outline: medium none;padding: 4px;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;_border:1px #d2d2d2 solid; _line-height:24px; _padding:0 5px; _height:24px;_background:url(../images/inputbg.gif); _width:100px;}
textarea {background-color: #f9f9f9;border: 1px solid #CCCCCC;border-radius: 2px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) inset;color: #666666;font-family: Arial,Verdana,'Helvetica Neue',Helvetica,Arial,Geneva,sans-serif;font-size: 12px;margin-bottom: 6px;outline: medium none;padding: 4px;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;}
textarea{vertical-align: middle;}
input.txt:focus, textarea:focus {background-color: #FCFDFF;border: 1px solid #A1D0FF;box-shadow: 0 0 2px #80BFFF, 0 1px 2px rgba(0, 0, 0, 0.15) inset;color: #000000;}

select {width:150px;background-color: #f9f9f9;border: 1px solid #CCCCCC;border-radius: 2px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) inset;color: #666666;font-family: Arial,Verdana,'Helvetica Neue',Helvetica,Arial,Geneva,sans-serif;font-size: 12px;height: 26px;margin-right:6px;margin-bottom: 6px;outline: medium none;padding: 4px;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;}
select:focus {background-color: #FCFDFF;border: 1px solid #A1D0FF;box-shadow: 0 0 2px #80BFFF, 0 1px 2px rgba(0, 0, 0, 0.15) inset;color: #000000;}
ul{
	list-style:none;
}

a {
    color: #252525;
    text-decoration: none;	
}
a:hover {
    color: #CC0000;
    text-decoration: none;
}
</style>

<style>
.divstart_publish {
    background-color: #E3E9EE;

    text-align: left;
    width: 900px;
}
.divstart_publish .divstart_bd {
	padding-left:180px;
	padding-bottom:0px;	
	margin:10px 10px;
    border: 1px solid #C7CBD1;
    background: url("<?=$this->_webroot('divstart/left.png')?>") repeat-y scroll 0 0 transparent;	
    background-color: #fff;	
}
.divstart_publish .divstart_bd .form{height:auto;overflow:hidden;margin:10px 10px 10px 0;}
.divstart_publish .divstart_bd .form table tr{border-top:1px dashed #c1d3e7;}
.divstart_publish .divstart_bd .form {padding:7px 0;border-bottom:1px dashed #c1d3e7;}
.divstart_publish .divstart_bd .form input,
.divstart_publish .divstart_bd .form TEXTAREA,
.divstart_publish .divstart_bd .form select{
    padding:4px;
}
.divstart_publish .divstart_bd .form .label{
	display:block;
	float:left;
	width:130px;
	text-align:right;
	font-size:14px;
	font-weight:bold
}
.divstart_publish .divstart_bd .form em{
	font-size:12px;
	font-weight:normal;
	font-style:normal;
}
.divstart_publish .divstart_bd .form .btn{
    background-color: #4db1e0;
	background: linear-gradient(to bottom, #4482c9 0%, #245d9f 100%) repeat scroll 0 0 transparent;
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4482c9',endColorstr='#245d9f',GradientType=0);
	color:#fff;
	font-size:14px;
	font-weight:bold;
	border:1px solid #244d7c;
	padding:5px 15px;
	padding:1px solid #538ed0;
}
.divstart_publish .divstart_left {
	display: inline;
    float:left;
	width:170px;
	margin-left:-180px;
}
.divstart_publish .divstart_left ul  {
	list-style:none;
	margin-top:15px;		
}
.divstart_publish .divstart_left ul li {
	margin-left:2px;	
 	padding-left:10px;	
    height:30px; 
    width:153px;	
    line-height: 30px;
    font-size: 15px;	
}
.divstart_publish .divstart_left ul li.cur {
    background-color: #fff;
    border-left: 5px solid #4380C0;	
    border-top: 1px solid #C7CBD1;
    border-bottom: 1px solid #C7CBD1;	
 	padding-left:6px;		
}
.divstart_publish .divstart_left ul li.cur a {	
    font-size: 14px;
    font-weight: bold;	
    color: #4380C0;	
    text-decoration: none;	
}
.divstart_publish .divstart_left ul li a:hover {	
    font-size: 14px;
    font-weight: bold;	
    color: #4380C0;	
    text-decoration: none;	
}
.clear{
	height:0px;
	overflow:hidden;
	/*clear:both;*/
}
.divstart_publish .divstart_right {
    background-color: #fff;
    /*float:right;*/
	width:690px;
	margin-right:10px;	
}
.divstart_publish .divstart_right .divstart_title {
    font-size: 14px;
    font-weight: bold;	
    color: #252525;	
	margin-top:20px;	
}
.divstart_publish .divstart_right .divstart_tip {
    background-color: #F0F9FA;
	margin-top:5px;
    border: 1px dashed #95BEED;	
}
.divstart_publish .divstart_right .divstart_tip span{
	margin-left:10px;
 	padding-left:10px;	    	
    width:40px;
	height:25px;
    line-height: 25px;	
    color: #fff;
    font-size: 14px;
    font-weight: bold;	
    background-color: #3D74B5;	
	display:block;	
}
.divstart_publish .divstart_right .divstart_tip h3{
	margin-left:10px;  
	margin-top:10px;   	
    color: #252525;
    font-size: 15px;
    font-weight: bold;			
}
.divstart_publish .divstart_right .divstart_tip p{
	padding:10px 0 10px 10px;
    color: #252525;
    font-size: 14px;		
}
.divstart_publish .divstart_right .divstart_config {
    background-color: #F0F9FA;
	margin-top:10px;
    border: 1px solid #86ADD8;		
    padding-bottom:10px;
}
.divstart_publish .divstart_right .divstart_config .title{
    background: url("<?=$this->_webroot('divstart/config.png')?>") repeat-x scroll 0 0 transparent;
	height:35px;
    border-bottom: 1px solid #86ADD8;	
    line-height: 35px;		
	display:block;	
    font-size: 14px;
    color: #252525;	
	padding-left:10px;	
}
.divstart_publish .divstart_right .divstart_config .title span{
    font-weight: bold;	
}
.divstart_publish .divstart_right .divstart_config .filed{
	padding:10px 0 10px 10px;
    font-size: 14px;
    color: #252525;	
}
.divstart_publish .divstart_right .divstart_config .filed span{
    font-weight: bold;	
}
.divstart_publish .divstart_right .divstart_config .filedtip{
	margin-top:6px;
 	padding:10px 10px; 
    border: 1px solid #A1C1E6;			
    font-size: 14px;
    color: #3D75B6;	
	margin-left:10px;	
	margin-right:10px;
    background-color: #fff;	
    position: relative;		
}
.divstart_publish .divstart_right .divstart_config .linetip {
    border-top: 1px dashed #95BEED;
	height:1px;
	margin-top:10px;
	margin-left:10px;	
	margin-right:10px;	
}

.divstart_publish .divstart_right .divstart_config .filedtip i{	
    background: url("<?=$this->_webroot('divstart/tip.png')?>") no-repeat scroll 0 0 transparent;
    height: 8px;
    width:10px;
    position: absolute;
    left: 15px;
    top: -7px;	
}
.divstart_publish .divstart_right .divstart_config .filedtip span{
    font-weight: bold;	
}

</style>
</head>
<body>

<div class="divstart_publish" >
		<div class="divstart_bd">		
		    <div class="divstart_left">
			    <ul>
					<li><a href="<?php echo $this->base;?>/index.php/tagsedit/viewmanageedit/?<?php echo $urlstr ; ?>" target="_self">标签修改</a></li>
					<li><a href="<?php echo $this->base;?>/index.php/tagsedit/viewmanageactiveedit/?<?php echo $urlstr ; ?>"   target="_self">标签时间控制</a></li>
					<li class="cur"><a href="<?php echo $this->base;?>/index.php/tagsedit/viewmanagetableedit/?<?php echo $urlstr ; ?>"   target="_self">表单数据调用</a></li>
                    <li><a href="<?php echo $this->base;?>/index.php/tagsedit/viewmanagetableuseredit/?<?php echo $urlstr ; ?>"   target="_self">用户数据修改</a></li>
					<li><a href="<?php echo $this->base;?>/index.php/tagsedit/viewmanagecacheedit/?<?php echo $urlstr ; ?>"   target="_self">缓存数据调用</a></li>											 
					<li><a href="<?php echo $this->base;?>/index.php/tagsedit/viewmanagehtmledit/?<?php echo $urlstr ; ?>"   target="_self">模板修改</a></li>
					<li><a href="<?php echo $this->base;?>/index.php/tagsedit/viewmanagelabeledit/?<?php echo $urlstr ; ?>"   target="_self">Labels修改</a></li>	
					<li><a href="<?php echo $this->base;?>/index.php/tagsedit/icondatalist/?<?php echo $urlstr ; ?>"   target="_self">缓存数据管理</a></li>													  
					<!-- <li><a href="<?php echo $fromurl ; ?>"   target="_self">返回主站</a></li>--> 			

				</ul>
			</div>
		    <div class="divstart_right">
			    <div class="divstart_title">表单数据调用</div> 				

			</div>
		    <div class="clear"></div>	
		    <div  class="form">


<?php 

if(!isset($data['iconname'])) { $data['iconname'] ='';} 
if(!isset($data['description'])) { $data['description'] ='';} 
if(!isset($data['iconcontent'])) { $data['iconcontent'] ='';} 
if(!isset($data['config']['tablename'])) { $data['config']['tablename'] ='';} 
if(!isset($data['config']['fields'])) { $data['config']['fields'] ='';} 
if(!isset($data['config']['order'])) { $data['config']['order'] ='';} 
if(!isset($data['config']['limit'])) { $data['config']['limit']='';} 
if(!isset($data['config']['conditions'])) { $data['config']['conditions']='';} 
if(!isset($data['config']['pageurl'])) { $data['config']['pageurl']='';} 
if(!isset($data['config']['cachedatadir'])) { $data['config']['cachedatadir']='';} 
if(!isset($data['config']['cachefields'])) { $data['config']['cachefields']='';} 
if(!isset($data['config']['icondata'])) { $data['config']['icondata']='';} 
if(!isset($data['config']['iconfields'])) { $data['config']['iconfields']='';} 
if(!isset($data['config']['labels'])) { $data['config']['labels']='';} 
if(!isset($data['config']['htmlname'])) { $data['config']['htmlname']='';} 
if(!isset($data['config']['htmlconfig'])) { $data['config']['htmlconfig']='';} 

?>                                
                                 


<form action="<?php echo $this->base; ?>/index.php/tagsedit/viewmanagetableedit?dopost=post" method="post" enctype="multipart/form-data" name="form1"  onSubmit="return post(this);">

<table width="100%" cellspacing="0" cellpadding="4" border="0" align="center"  class="table_style">
<tbody>

    <tr  onMouseOut="this.className=''" onMouseOver="this.className='bgcolor'"> 
      <td  colspan="2" > 
		<div style="clear:both">
					<font color=red>*</font><strong>数据类型</strong>:
					<select name="fenorxin"  onChange="form_choose(this.options[this.selectedIndex].value)">
					 <option value="0" <?php if($is_fenorxin == 0) { ?> selected <?php } ?>>调用指定信息</option>			
					 <option value="1"  <?php if($is_fenorxin == 1) { ?> selected <?php } ?> >调用分类信息</option> 
					</select>
		</div>	  
	  <font color=red>*</font><strong>栏目选择</strong>:<br/>	  
	  
        <!--
-->
<style>
.pub_cate_menu{ 
border:1px #CCCCCC solid; 
background-color:#f9f9f9;
color:#333333;
width:300px;
height:200px;
float:left;
overflow-Y:auto;
overflow-X:hidden;
margin-right:5px; 
padding:5px;
}
.pub_cate_menu a{
color:#343434;
line-height:150%;
}
.pub_cate_menu .selected{
 font-weight:bold; color:#FF3300; padding-right:20px; background:url("<?php echo $this->_webroot('images/icn_ok.gif'); ?>") right no-repeat;
}
.pub_cate_menu unselected{
}

.choosedok{ width:500px;}

</style>

<div id="cate_menu" style="display:block">
<div class="pub_cate_menu"  style="width:250px;"id="cate_menu_1">
<?php foreach($changeClassName as $_key => $_value ) { ?>
	<div>
	    <a href="javascript:;" onClick="changeClassName(1,this,'<?php echo $_value['table'] ; ?>,<?php echo $_value['filed1'] ; ?>|<?php echo $_value['filed2'] ; ?>',true,0,'<?php echo $this->base;?>/index.php/tagsedit/viewmanagetableedit/');" ><?php echo $_value['name'] ; ?></a> 
	</div>
	<?php if(isset($changeClassName_data[$_key]) && !empty($changeClassName_data[$_key]) ) { ?>
	    <?php foreach(array_slice ($changeClassName_data[$_key][0], 0) as $_key1 => $_value1 ) { ?>
	    <div>
		    <input type='checkbox' name='cids[]' <?php if(isset($conitions_catids[$_value['table'].','.$_value['filed1'].'|'.$_value['filed2'].','.$_value1[$_value['catfiled1']]])) {echo 'checked';}?> value='<?php echo $_value['table'] ; ?>,<?php echo $_value['filed1'] ; ?>|<?php echo $_value['filed2'] ; ?>,<?php echo $_value1[$_value['catfiled1']] ; ?>' id='<?php echo $_value['table'] ; ?>,<?php echo $_value['filed1'] ; ?>|<?php echo $_value['filed2'] ; ?>,<?php echo $_value1[$_value['catfiled1']] ; ?>' >		
		    <a href="javascript:;" onClick="changeClassName(1,this,'<?php echo $_value['table'] ; ?>,<?php echo $_value['filed1'] ; ?>|<?php echo $_value['filed2'] ; ?>,<?php echo $_value1[$_value['catfiled1']] ; ?>',true,0,'<?php echo $this->base;?>/index.php/tagsedit/viewmanagetableedit/');" >|--<?php echo $_value1[$_value['catfiled2']] ; ?></a>
		</div>  
	        <?php if(isset($changeClassName_data[$_key][$_value1[$_value['catfiled1']]]) && !empty($changeClassName_data[$_key][$_value1[$_value['catfiled1']]])) { ?>
			   <?php foreach(array_slice ($changeClassName_data[$_key][$_value1[$_value['catfiled1']]], 0) as $_key2 => $_value2 ) { ?>
	           <div>
					<input type='checkbox' name='cids[]' <?php if(isset($conitions_catids[$_value['table'].','.$_value['filed1'].'|'.$_value['filed2'].','.$_value2[$_value['catfiled1']]])) {echo 'checked';}?> value='<?php echo $_value['table'] ; ?>,<?php echo $_value['filed1'] ; ?>|<?php echo $_value['filed2'] ; ?>,<?php echo $_value2[$_value['catfiled1']] ; ?>' id='<?php echo $_value['table'] ; ?>,<?php echo $_value['filed1'] ; ?>|<?php echo $_value['filed2'] ; ?>,<?php echo $_value2[$_value['catfiled1']] ; ?>' >			   
			        <a href="javascript:;" onClick="changeClassName(1,this,'<?php echo $_value['table'] ; ?>,<?php echo $_value['filed1'] ; ?>|<?php echo $_value['filed2'] ; ?>,<?php echo $_value2[$_value['catfiled1']] ; ?>',true,0,'<?php echo $this->base;?>/index.php/tagsedit/viewmanagetableedit/');" >|--|--<?php echo $_value2[$_value['catfiled2']] ; ?></a>

				</div>  
               <?php } ?>
            <?php } ?>			
		<?php } ?>
	<?php } ?>
<?php } ?>
	
 
</div>

<div class="pub_cate_menu"  style="width:380px;" id="cate_menu_2"></div>

 
</div>

<iframe id="likeajaxform" src="about:blank" style="display:none;"></iframe>

<input type="hidden" value="0" id="fid"  name="fid"/>
<input name="ctype" type="hidden" id="ctype" value="0" />
<input name="id" type="hidden" id="id" value="0" />

<div id="shifouxianshi1" style="clear:both;  padding:5px 8px 8px 35px;background:url('<?php echo $this->_webroot('images/jiantou.jpg'); ?>') left no-repeat;"  class="jiantou">
<span id="choosed" class="post_notice " >您当前选择的是:</span> &nbsp; 
 <input type="button"  value="↓ 添加" id="nextdo" name="nextdo" disabled="disabled" class="btn" onClick="addFid();"/>
</div>
<div id="shifouxianshi2"  style="width:650px;" class="pub_cate_menu choosedok">
<strong>已经选择好的项目</strong>：(最多添加100个项目,<input name="no" type="checkbox" value="0" /><font color="blue">取消勾选即为移除对应分类</font>)
<div id="fiddb"  style="width:650px;" >
<?php echo $icontabledata ; ?>

</div>

</div>


<div style="clear:both;padding-top:10px;" id="datatiao1" >显示条数:&nbsp;&nbsp;&nbsp;<input type="text" name="limitnum" class="txt"  value="<?php echo $limitnum ;?>" size="20"></div>

<div style="clear:both;margin-top:5px;" id="datatiao2" >排序:&nbsp;&nbsp;&nbsp;<span id="dataorder"><?php echo $user_order;?></span></div>
<div style="clear:both;margin-top:5px;" id="datatiao3" >条件:&nbsp;&nbsp;&nbsp;<span id="dataconditions"><?php echo $user_conditions;?></span></div>

                                 



      </td>
    </tr>

<tr onMouseOut="this.className=''" onMouseOver="this.className='bgcolor'">
	<td colspan="2">
	  <font color=red>*</font><strong>样式选择</strong>:<br/>	
<style>
/**********/
.mtop a{
	display:block;
	float:left;
	width:75px;
	height:19px;
	margin-top:5px;
	background:url(button_b.gif);
	text-align:center;
	margin-right:2px;
	padding-top:3px
}
.mtop a.cht{
	color:#fff;
	font-weight:bold;
	background:url(button_a.gif);
}
.mtop{
	border-bottom:2px solid #99D3FB;
}

.showpicdiv{
	border:5px solid #B9D5F2;
}
.showpicdiv2{
	border:1px solid red;
}

.disableTR td,.disableTR td input,.disableTR td a,.disableTR td a:visited,.disableTR td font{
	color:#ccc;
	border:0px;
}
.disableTR td img{
	width:4px;
	height:4px;
}


</style>



<SCRIPT LANGUAGE="JavaScript">
<!--
function get_obj(obj){
   return document.getElementById(obj);
}
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
<!--
function post(form){
	var ifck=0;
	for(var i=0;i<ImgLinks.length;i++){
		jpgpath=ImgLinks[i];
		if(get_obj("tplpath").value==jpgpath){
			if(upfile_PicNumId==i){
				ifck=1;
			}
		}
	}

	if(get_obj("tplpath").value!=''&&ifck==0){
		var ck=confirm("你选中当前预览的模板,是否要选择?\n\n按确定,将返回选择!\n按取消,则不选择,而立即提交!");
	}
	if(ck==true){
		useThisTpl(ImgLinks[upfile_PicNumId]);
		return false;
	}
	if(form.tplpart_1.value==''){
		alert("模板不能为空,否则不能正常显示内容");
		form.tplpart_1.focus();
		return false;
	}

}

//-->

</SCRIPT>

<table width="100%" border="0" cellspacing="1" cellpadding="3" class="tablewidth">
    <tr  align="center"> 
      <td colspan="2"> &nbsp; 
        <table width="100%" border="0" cellspacing="1" cellpadding="3"  id="tb2">
          <tr  id="preview"> 
            <td > 
              <input type="hidden" name="tplpath" value="<?php echo $relativepath; ?>/<?php echo $htmlname ;?>.html" id="tplpath">
              <table  border="0" cellspacing="0" cellpadding="0">
			  
<tr><td style="padding-left:20px;padding-bottom:10px;"><select id="selectTyls" onChange="selectTpl(this)">
 <?php $biao = 0 ; $num = 1 ; ?>
    <option value='0'>快速选择</option>
   
<?php foreach((array)$htmlnamearray as $_key => $_value ) { ?>    
    <option value='<?php echo $this->base; ?><?php echo $relativepath; ?>/<?php echo $_key ; ?>.jpg'  ><?php echo $_key ; ?></option>
	<?php if( $htmlname == $_key ) { $biao = $num ; } ?>
	<?php $num ++ ; ?>
<?php } ?>   
    <option value='0'></option>  

  </select> [<a href="#LOOK" onClick="show_MorePic(-1)">上一个</a>] 

      【<span id="upfile_PicNum">1/2</span>】[<a href="#LOOK" onClick="show_MorePic(1)">下一个</a>]  

       <span id="clickput"></span> 	

</td></tr>

  <tr>

    <td height="30" style="padding-left:20px;"><div id="showpicdiv" class="showpicdiv" ><A style="border:2px solid #fff;display:block;" HREF="#" onClick="show_MorePic(1)"  id="showPicID"><img border="0"  onload="if(this.height>200)this.height='200';" id="upfile_PicUrl"></A></div><div id="MSG_say"></div></td>

  </tr>

</table>

<SCRIPT LANGUAGE="JavaScript">

var ImgLinks= new Array(<?php foreach((array)$htmlnamearray as $_key => $_value ) { ?>"<?php echo $this->base; ?><?php echo $relativepath; ?>/<?php echo $_key ;?>.jpg",<?php } ?>"");

var ImgTitle= new Array(<?php foreach((array)$htmlnamearray as $_key => $_value ) { ?>"<?php echo $_key ;?>",<?php } ?>"");

function replace_img(url)
{
	return url;
}

</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
<!--
var upfile_PicNumId=0;

function show_MorePic(todo){

	if(todo==1){

		upfile_PicNumId++;

	}else if(todo==-1){

		upfile_PicNumId--;

	}

	if(upfile_PicNumId<0){
		alert("已经是第一个了!");
		upfile_PicNumId=0;
	}

	if( upfile_PicNumId>(ImgLinks.length-1) ){
		alert("已经是最后一个了!");
		upfile_PicNumId=ImgLinks.length-1;
	}
	showTplDiv();
	NUM=upfile_PicNumId+1;
	document.getElementById("selectTyls").options[NUM].selected = true;

}

show_MorePic(<?php echo $biao ; ?>)



function selectTpl(selObj){

	n=selObj.selectedIndex;

	value=selObj.options[n].value

	if(n<1){

		return;

	}

	upfile_PicNumId=n-1;

	showTplDiv();

}



function showTplDiv(){

	document.getElementById("upfile_PicNum").innerHTML="<font color=red>"+(upfile_PicNumId+1)+"</font>/"+ImgLinks.length;

	document.getElementById("clickput").innerHTML='<input onclick=useThisTpl("'+ImgLinks[upfile_PicNumId]+'") type="button" name="Submit" value="使用此模板" style="border:1px solid #000;background:red;color:#fff;">';

	upfile_PicUrl=document.getElementById("upfile_PicUrl");

	jpgpath=ImgLinks[upfile_PicNumId];

	if(get_obj("tplpath").value==jpgpath){

		get_obj("showpicdiv").className='showpicdiv2';

	}else{

		get_obj("showpicdiv").className='showpicdiv';

	}

	upfile_PicUrl.src=ImgLinks[upfile_PicNumId];
	upfile_PicUrl.alt=ImgTitle[upfile_PicNumId];	

	//让选中的模板红色显示

	for(var i=0;i<ImgLinks.length;i++){

		NUM=i+1;
		jpgpath=ImgLinks[i];
		if(get_obj("tplpath").value==jpgpath){

			document.getElementById("selectTyls").options[NUM].style.color = 'red';

		}else{

			document.getElementById("selectTyls").options[NUM].style.color = '#000';

		}

	}

	re   = /\.jpg/g;

	link_s = ImgLinks[upfile_PicNumId].replace(re, ".html");

	get_obj("MSG_say").innerHTML="当前模板文件:<A title='你可以创建更多的模板放在此目录即可' HREF='"+link_s+"' target=_blank>"+link_s.replace(/(.*)<?php echo $bianrelativepath; ?>/g,"<?php echo $yuanrelativepath; ?>")+"</A>";

}
//-->
</SCRIPT>

            </td>

          </tr>

          <tr  id="TRtpl_1">
            <td > 
                    <textarea name="tplpart_1" id="tplpart_1" cols="120" rows="8" style="height:150px;"><?php echo $code ;?></textarea>
            </td>

          </tr>
          <tr >
            <td > 
                <input type="radio" name="mokuai" value="1"   >创建新模板&nbsp;&nbsp;&nbsp;<input type="radio" name="mokuai" value="0"  checked   >修改模板
            </td>
          </tr>


        </table>


      </td>

    </tr>

</table>



<script language="JavaScript">
function puthtmlcode(code)
{
	get_obj("tplpart_1").value=code;
	get_obj("tplpart_1").focus();
}

function useThisTpl(tpl)
{
	re   = /\.jpg/g;
	tpl = tpl.replace(re, ".html");	
	get_obj("tplpath").value=tpl.replace(/(.*)<?php echo $bianrelativepath; ?>/g,"<?php echo $yuanrelativepath; ?>");
	get_obj("showpicdiv").className='showpicdiv2';
	window.open("<?php echo $this->base;?>/index.php/tagsedit/viewmanagetableedit/?dopost=getTplcode&divid=tplpart_1&filepath="+tpl,target='phpframe');
}

function loadtpl()
{
	for(var i=0;i<ImgLinks.length;i++)
	{
		jpgpath=ImgLinks[i];
		if(get_obj("tplpath").value==jpgpath)
		{
			upfile_PicNumId=i;
		}
	}
	NUM=upfile_PicNumId+1;
	document.getElementById("selectTyls").options[NUM].selected = true;
	showTplDiv();
}

loadtpl();

</script>

<iframe id="phpframe" name="phpframe" marginwidth="0" src="about:blank" frameborder="0" height="0" width="0"></iframe> 
    
    </td>
</tr>
 <SCRIPT LANGUAGE="JavaScript">
<!--

function MM_keyword2(selObj,str){ //v3.0
  va=selObj.options[selObj.selectedIndex].value
  if (va!='')
  {

		get_obj(str).value=va;

  } 
}

//-->
</script>	
									 
    	                                 

<tr onMouseOut="this.className=''" onMouseOver="this.className='bgcolor'">

	<td colspan="2">
	  <font color=red>*</font><strong>值相对</strong>:
<input  type="hidden" size="3" name="nums" value="1">
        <input type="button" name="Submit2" value="增加一项" class="btn" onClick=showinput()>	
<br/>			
	
     <div id=input>
<?php $num = 0 ; ?>	 
<?php foreach((array)$iconfielddata as $_key => $_value ) { ?>

Icon标签(<?php echo $num ; ?>):　　 <input type="text"  value="<?php echo $_key ; ?>" class="txt"   name="data[<?php echo $num ; ?>][datakey]"  size="20"   id="key_id_<?php echo $num ; ?>">&nbsp;&nbsp;
<select name="select3" onChange="MM_keyword2(this,'key_id_<?php echo $num ; ?>')" >
<option  value="">请选择...</option>
<option  value="icon">&nbsp;|&nbsp;&nbsp;&nbsp;icon</option>
<option  value="icon1">&nbsp;|&nbsp;&nbsp;&nbsp;icon1</option>
<option  value="icon2">&nbsp;|&nbsp;&nbsp;&nbsp;icon2</option>
<option  value="icon3">&nbsp;|&nbsp;&nbsp;&nbsp;icon3</option>
<option  value="icon4">&nbsp;|&nbsp;&nbsp;&nbsp;icon4</option>
<option  value="icon5">&nbsp;|&nbsp;&nbsp;&nbsp;icon5</option>
<option  value="icon6">&nbsp;|&nbsp;&nbsp;&nbsp;icon6</option>
<option  value="icon7">&nbsp;|&nbsp;&nbsp;&nbsp;icon7</option>
<option  value="icon8">&nbsp;|&nbsp;&nbsp;&nbsp;icon8</option>
<option  value="icon9">&nbsp;|&nbsp;&nbsp;&nbsp;icon9</option>
<option  value="icon10">&nbsp;|&nbsp;&nbsp;&nbsp;icon10</option>
</select><br/>
对应数据库字段名:　　<input type="text" name="data[<?php echo $num ; ?>][datavalue]" class="txt"  size="20" value="<?php echo $_value ; ?>"  id="value_id_<?php echo $num ; ?>" >&nbsp;&nbsp;
<select name="select4" onChange="MM_keyword2(this,'value_id_<?php echo $num ; ?>')" >
<option  value="">请选择...</option>

<?php foreach($tablename_array as $_key => $_value)
	  {		    
		    foreach($tablearray[$DbPrefix.$_value['table']] as $_key1 => $_value1)
		    {	
?>		             
             <option  value="<?php echo $_value1 ; ?>">&nbsp;|&nbsp;&nbsp;&nbsp;<?php echo $_key1 ; ?></option>
			 	   
	 <?php  } ?>
			<optgroup label="===================" style="color:red;"></optgroup>	 

<?php  } ?>
	 
</select>
<br><hr size=1 color="#FF0000">

<?php $num ++ ; ?>
<?php } ?>	 
	 
	 </div>	
	
	
	</td>
</tr>
<script>

function showinput()
{
    if(select_str=='')
	{
		alert('请先进行栏目选择！');
		return false;
	}
	var str=input.innerHTML;
	var num=2;
	var N=0;
	num=document.form1.nums.value;
	oo=document.body.getElementsByTagName("input");
	for(var j=0;j<oo.length-1;j++){	
		if(oo[j].getAttribute("name").indexOf('data')==0){		
			N++;
		}
	}

	for(var i=0;i<num;i++){
		N++;
		str+='Icon标签('+N+'):　　 <input type="text"  value="" class="txt"   name="data['+N+'][datakey]"  size="20"   id="key_id_'+N+'">&nbsp;&nbsp;<select name="select3" onChange="MM_keyword2(this,\'key_id_'+N+'\')" ><option  value="">请选择...</option><option  value="icon">&nbsp;|&nbsp;&nbsp;&nbsp;icon</option><option  value="icon1">&nbsp;|&nbsp;&nbsp;&nbsp;icon1</option><option  value="icon2">&nbsp;|&nbsp;&nbsp;&nbsp;icon2</option><option  value="icon3">&nbsp;|&nbsp;&nbsp;&nbsp;icon3</option><option  value="icon4">&nbsp;|&nbsp;&nbsp;&nbsp;icon4</option><option  value="icon5">&nbsp;|&nbsp;&nbsp;&nbsp;icon5</option><option  value="icon6">&nbsp;|&nbsp;&nbsp;&nbsp;icon6</option><option  value="icon7">&nbsp;|&nbsp;&nbsp;&nbsp;icon7</option><option  value="icon8">&nbsp;|&nbsp;&nbsp;&nbsp;icon8</option><option  value="icon9">&nbsp;|&nbsp;&nbsp;&nbsp;icon9</option><option  value="icon10">&nbsp;|&nbsp;&nbsp;&nbsp;icon10</option></select><br/>';

		if(select_str)
		{
		str+='对应数据库字段名:　　<input type="text" name="data['+N+'][datavalue]" class="txt"  size="20" value=""  id="value_id_'+N+'" >&nbsp;&nbsp;<select name="select4" onChange="MM_keyword2(this,\'value_id_'+N+'\')" ><option  value="">请选择...</option>'+select_str+'</select><br><hr size=1 color="#FF0000">';			 
		}
		else
		{
		str+='对应数据库字段名:　　<input type="text" name="data['+N+'][datavalue]" class="txt"  size="20" value=""  id="value_id_'+N+'" ><br><hr size=1 color="#FF0000">';		
		}
	}
	input.innerHTML=str;
}
</script>

<tr>
	<td>&nbsp;</td>
	<td>
	<input type="hidden" name="pagename" value="<?php echo $pagename ; ?>" />
	<input type="hidden" name="strtempdata" value="<?php echo $strtempdata; ?>" />
	<input type="hidden" name="fromurl" value="<?php echo $weburl; ?>" />
	
	<input type="hidden" name="compeld" value="<?php echo $compeld; ?>" />	
	<input type="hidden" name="webroot" value="<?php echo $webroot; ?>" />
	<input type="hidden" name="app" value="<?php echo $app; ?>" />
	<input type="hidden" name="act" value="<?php echo $act; ?>" />
	
	<input type="hidden" name="data[dopost]" value="post" />	
	<input type="submit" value=" 提 交 " class="btn">
	
	</td>
</tr>
</tbody></table>
</form>                                 
                                 
  <div style="display:none;"> 

  <form name="form2" method="post" action="" target="phpframe">

  </form>

</div>                            
                  			


<SCRIPT LANGUAGE="JavaScript">
<!--
function get_obj(obj){
   return document.getElementById(obj);
}

function form_choose(t)
{	
	if(t=='1')
	{
		get_obj('datatiao1').style.display='';	
		get_obj('datatiao2').style.display='';	
		get_obj('datatiao3').style.display='';	
		get_obj('cate_menu_2').style.display='none';	
		get_obj('shifouxianshi1').style.display='none';	
		get_obj('shifouxianshi2').style.display='none';
		oo=document.body.getElementsByTagName("input");
		for(var j=0;j<oo.length-1;j++){	
			if(oo[j].getAttribute("name").indexOf('cids')==0){		
				oo[j].style.display='';
			}
		}		
	}else
	{
		get_obj('datatiao1').style.display='none';	
		get_obj('datatiao2').style.display='none';	
		get_obj('datatiao3').style.display='none';
		get_obj('cate_menu_2').style.display='';
		get_obj('shifouxianshi1').style.display='';		
		get_obj('shifouxianshi2').style.display='';	
		oo=document.body.getElementsByTagName("input");
		for(var j=0;j<oo.length-1;j++){	
			if(oo[j].getAttribute("name").indexOf('cids')==0){		
				oo[j].style.display='none';
			}
		}		
	}	
}
form_choose('<?php echo $is_fenorxin;?>');
//-->
</SCRIPT> 


<script language="javascript">
var g_page=1;
var g_fid = '';
var start_fid='';
var select_str = '';
var nowclass_name = '<?php echo $nowclass_name;?>';
var old_input_html = document.getElementById('input').innerHTML;
//发布页选择类目JS动作
function changeClassName(slevel,my,fid,next,ctype,Murl,page=0,keyword='')
{
    if(start_fid=='')
	{
	start_fid = fid;
	}
    if(start_fid)
	{
	  str1 = start_fid.split(",");
	  str2 = fid.split(",");
	  if(str1[0]!=str2[0])
	  {
	  	start_fid = fid;
		document.getElementById('cate_menu_2').innerHTML="";
		document.getElementById('fiddb').innerHTML="";
		document.getElementById('input').innerHTML="";		  
	  }
	}
	if(fid.indexOf(nowclass_name) == -1 ){
		document.getElementById('input').innerHTML="";	
	}else {
		document.getElementById('input').innerHTML=old_input_html;		
	}	
    if(fid==g_fid)
	{
	   g_page++;	   
	}else{
	g_page=1;
	}
	if(!page) {
	    page = g_page;
	}
	g_fid=fid;
	if(slevel>4) return false;
	for(var i=slevel+1;i<=2;i++){
		document.getElementById('cate_menu_'+String(i)).innerHTML="";			
	}
	
	document.getElementById("likeajaxform").src=Murl+'?dopost=getfidsonslist&fup='+fid+'&class='+String(slevel+1)+"&ctype="+ctype+"&page="+page+"&keyword="+keyword;
	
	var mydiv =document.getElementById('cate_menu_'+String(slevel));
	var mydivs=mydiv.getElementsByTagName('a');
	for(var i=0;i<mydivs.length;i++)
	{	
		mydivs[i].className='unselected';
	}
	my.className='selected';
	document.getElementById('fid').value=fid;
	if(document.getElementById(fid)) {
	    document.getElementById(fid).checked='checked';
    }	
	if(next==false){
		document.getElementById('nextdo').disabled=false;
	}else{
		document.getElementById('nextdo').disabled="disabled";
	}	
	create_mycate(slevel);	
}

function changekeyword(slevel,my,fid,next,ctype,Murl,page=0){
    var kw = my.value;
    changeClassName(slevel,my,fid,next,ctype,Murl,page,kw);
}

function create_mycate(slevel)
{
	var str='您当前选择的是:<font color="#232323">';
	for(var i=1;i<=slevel;i++)
	{
		var str2=getmydivs_choosedName(i);
		if(str2!=''){
		str+=" &gt; ";
		str+=str2;
		}		
	}
	document.getElementById('choosed').innerHTML=str+"</font>";
}
function getmydivs_choosedName(myi)
{
	var mydiv =document.getElementById('cate_menu_'+String(myi));
	var mydivs=mydiv.getElementsByTagName('a');
	for(var i=0;i<mydivs.length;i++)
	{	
		if(mydivs[i].className=='selected'){
			return mydivs[i].innerHTML;
		}
	}
	return "";

}
function inputcontent(content,slevel,select_str1,user_order,user_conditions){
    if(content=='&nbsp;')
	{
		alert('当前是该分类的最后一页内容，请切换分类进行选择！');
		return true ;
	}
	inputcontent_to(content,'cate_menu_'+String(slevel),select_str1,user_order,user_conditions);
}
function inputcontent_to(content,id,select_str1,user_order,user_conditions){
    select_str = select_str1;
	document.getElementById(id).innerHTML=content;
	document.getElementById('dataorder').innerHTML=user_order;	
	document.getElementById('dataconditions').innerHTML=user_conditions;	
}

function addFid(){
	var fid=document.getElementById('fid').value;
	var str=document.getElementById('choosed').innerHTML.replace("您当前选择的是:"," ");
	var fiddb=document.getElementById('fiddb');
	try{
		var fiddbname=fiddb.getElementsByTagName('input');
		if(fiddbname.length>=100){
			alert('最多添加100个项目');
			return false;
		}
		for(var i=0;i<fiddbname.length;i++){
			if(fiddbname[i].value==fid){
				alert('不能重复添加!');
				return false;
			}
		}		
	}catch(e){
		
	}
	var onestr="<div id='div_"+fid+"'><input type='checkbox' name='fids[]' value='"+fid+"' checked onclick='removeFid(this);'> "+str+"</div>";
	fiddb.innerHTML=fiddb.innerHTML+onestr;
}
function removeFid(me){
	if(!confirm('确定放弃此项吗?')){
		me.checked=' checked';
		return false;
	}else{
		
		document.getElementById("div_"+me.value).innerHTML="";	
		document.getElementById("div_"+me.value).outerHTML="";	
		
	}
}
</script>





							
			
		    </div>		
		</div>
</div>
</body>
</html>